﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maestro.master" AutoEventWireup="true" CodeFile="Aseguradora.aspx.cs" Inherits="Aseguradora" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">

        .style2
        {
            height: 19px;
        }
        .style3
        {
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table cellspacing="1" align="center">
        <tr>
            <td align="center" bgcolor="White" >
                <table align="center">
                    <tr>
                        <td>
                                </aspxtextbox>
                            <asp:TextBox ID="txtBuscar" runat="server" AutoPostBack="True" 
                                ontextchanged="txtBuscar_TextChanged" 
                                ToolTip="Se buscará por Razon Social, CUIT, Descripción. Contacto y Email"></asp:TextBox>
                            </td>
                        <td>
                            <asp:ImageButton ID="btnBuscar" runat="server" Height="22px" 
                                    ImageUrl="~/Imagenes/lupa.gif" onclick="btnBuscar_Click1" ToolTip="Buscar" 
                                    CausesValidation="False" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="White" class="style3">
                <asp:FormView ID="fvAseguradora" runat="server" DataSourceID="dsAseguradora" 
                        oniteminserting="fvPersonal_ItemInserting" EnableModelValidation="True" 
                        Width="128px" DataKeyNames="ID">
                    <EditItemTemplate>
                        <table cellpadding="2" cellspacing="2" class="style1">
                            <tr>
                                <td class="style8">
                                        Razon Social</td>
                                <td nowrap="nowrap">
                                    <asp:TextBox ID="txtRazonSocial" runat="server" 
                                        Text='<%# Bind("RazonSocial") %>' Width="300px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                            ControlToValidate="txtRazonSocial" ErrorMessage="RequiredFieldValidator" 
                                            ToolTip="Debe ingresar un valor" ValidationGroup="EditarInsertar">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td >
                                    CUIT</td>
                                <td >
                                    <asp:TextBox ID="txtCUIT" runat="server" Text='<%# Bind("CUIT") %>' />
                                    </td>
                            </tr>
                            <tr>
                                <td >
                                    Descripción</td>
                                <td >
                                    <asp:TextBox ID="txtDescripcion" runat="server" Text='<%# Bind("Descripcion") %>' 
                                        Width="300px" />
                                    </td>
                            </tr>
                            <tr>
                                <td >
                                    Contacto nombre</td>
                                <td >
                                    <asp:TextBox ID="txtContactoNombre" runat="server" 
                                        Text='<%# Bind("ContactoNombre") %>' />
                                    </td>
                            </tr>
                            <tr>
                                <td >
                                    Contacto teléfono</td>
                                <td >
                                    <asp:TextBox ID="txtContactoTelefono" runat="server" 
                                        Text='<%# Bind("ContactoTelefono") %>' />
                                    </td>
                            </tr>
                            <tr>
                                <td >
                                    Email</td>
                                <td >
                                    <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("Email") %>' 
                                        Width="300px" />
                                    </td>
                            </tr>
                            <tr>
                                <td >
                                    Dirección</td>
                                <td >
                                    <asp:TextBox ID="txtDireccion" runat="server" Text='<%# Bind("Direccion") %>' 
                                        Width="300px" />
                                    </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap" >
                                    Duración cuenta corriente</td>
                                <td ><div align="left" style="float: left">
                                    <asp:TextBox ID="txtDuracionCuentaCorriente" runat="server" 
                                        Text='<%# Bind("DiasDuracionCuentaCorriente") %>' Width="30px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ControlToValidate="txtDuracionCuentaCorriente" ErrorMessage="*" 
                                        ToolTip="Debe ingresar un número" ValidationGroup="EditarInsertar"></asp:RequiredFieldValidator>
                                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                        ControlToValidate="txtDuracionCuentaCorriente" ErrorMessage="*" 
                                        MaximumValue="999" MinimumValue="1" 
                                        ToolTip="Debe ingresar un entero entre 1 y 999" Type="Integer" 
                                        ValidationGroup="EditarInsertar"></asp:RangeValidator>
                                    </div>
                                        <div style="float: left; clip: rect(auto, auto, auto, auto);">
                                    días</div></td>
                            </tr>
                            <tr>
                                <td class="dxncEmptyData_Soft_Orange">
                                        Estado</td>
                                <td nowrap="nowrap">
                                    <table cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td class="style3">
                                                <asp:Label ID="lblEstado" runat="server" ForeColor='<%# Eval("EstadoColor") %>' 
                                                        Text='<%# Eval("EstadoString") %>' />
                                                    &nbsp;
                                                </td>
                                            <td class="style3">
                                                <dxe:aspxbutton ID="btnActivar" runat="server" 
                                                             CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                             CssPostfix="Office2003_Olive" Text="Activar" onclick="btnActivar_Click" 
                                                             Visible='<%# Eval("EstadoPuedeActivar") %>' 
                                                             ValidationGroup="EditarInsertar">
                                                </dxe:ASPxButton>
                                                <dxe:aspxbutton ID="btnInactivo" runat="server" 
                                                             CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                             CssPostfix="Office2003_Olive" Text="Eliminar" onclick="btnInactivo_Click" 
                                                             Visible='<%# Eval("EstadoPuedeInactivar") %>' 
                                                             ValidationGroup="EditarInsertar">
                                                    <ClientSideEvents Click="function(s,e) { e.processOnServer = confirm('Va a eliminar el registro, ¿está seguro?'); }" />
                                                </dxe:ASPxButton>
                                            </td>
                                            <td class="style3">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                        &nbsp;</td>
                                <td style="margin-left: 160px">
                                        &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2" style="margin-left: 160px" nowrap="nowrap">
                                    <table align="center">
                                        <tr>
                                            <td>
                                                <dxe:aspxbutton ID="btnActualizar" runat="server" CommandName="Update" 
                                                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="Actualizar" 
                                                        ValidationGroup="EditarInsertar">
                                                </dxe:ASPxButton>
                                            </td>
                                            <td>
                                                    &nbsp;</td>
                                            <td>
                                                <dxe:aspxbutton ID="btnCancelar" runat="server" CausesValidation="False" 
                                                        CommandName="Cancel" CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="Cancelar" 
                                                        ValidationGroup="EditarInsertar">
                                                </dxe:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:HiddenField ID="hfID" runat="server" 
                                            Value='<%# Bind("ID") %>' />
                                    <asp:HiddenField ID="hfEstaActivo" runat="server" 
                                            Value='<%# Bind("EstaActiva") %>' />
                                        &nbsp;</td>
                            </tr>
                        </table>
&nbsp;
                        </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table align="center" class="style1">
                            <tr>
                                <td>
                                        &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                        &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="center" width="400">
                                    <asp:Label ID="Label1" runat="server" Text="Seleccione una unidad de medida" Width="400px" 
                                            style="color: #808080"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                        &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                        &nbsp;</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <table cellpadding="2" cellspacing="2" class="style1">
                            <tr>
                                <td class="style8">
                                    Razon Social</td>
                                <td nowrap="nowrap">
                                    <asp:TextBox ID="txtRazonSocial" runat="server" 
                                        Text='<%# Bind("RazonSocial") %>' Width="300px" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="txtRazonSocial" ErrorMessage="RequiredFieldValidator" 
                                        ToolTip="Debe ingresar un valor" ValidationGroup="EditarInsertar">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    CUIT</td>
                                <td>
                                    <asp:TextBox ID="txtCUIT" runat="server" Text='<%# Bind("CUIT") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Descripción</td>
                                <td>
                                    <asp:TextBox ID="txtDescripcion" runat="server" Text='<%# Bind("Descripcion") %>' 
                                        Width="300px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Contacto nombre</td>
                                <td>
                                    <asp:TextBox ID="txtContactoNombre" runat="server" 
                                        Text='<%# Bind("ContactoNombre") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Contacto teléfono</td>
                                <td>
                                    <asp:TextBox ID="txtContactoTelefono" runat="server" 
                                        Text='<%# Bind("ContactoTelefono") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Email</td>
                                <td>
                                    <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("Email") %>' 
                                        Width="300px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Dirección</td>
                                <td>
                                    <asp:TextBox ID="txtDireccion" runat="server" Text='<%# Bind("Direccion") %>' 
                                        Width="300px" />
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    Duración cuenta corriente</td>
                                <td>
                                    <div align="left" style="float: left">
                                        <asp:TextBox ID="txtDuracionCuentaCorriente" runat="server" Width="30px" 
                                            Text='<%# Bind("DiasDuracionCuentaCorrienteString") %>' />
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                            ControlToValidate="txtDuracionCuentaCorriente" Display="Dynamic" 
                                            ErrorMessage="*" ToolTip="Debe ingresar un número" 
                                            ValidationGroup="EditarInsertar"></asp:RequiredFieldValidator>
                                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                            ControlToValidate="txtDuracionCuentaCorriente" Display="Dynamic" 
                                            ErrorMessage="*" MaximumValue="999" MinimumValue="1" 
                                            ToolTip="Debe ingresar un entero entre 1 y 999" Type="Integer" 
                                            ValidationGroup="EditarInsertar"></asp:RangeValidator>
                                        &nbsp;&nbsp;&nbsp;
                                    </div>
                                    <div style="float: left; clip: rect(auto, auto, auto, auto);">
                                        días</div>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4">
                                    &nbsp;</td>
                                <td style="margin-left: 160px">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="2" nowrap="nowrap" style="margin-left: 160px">
                                    <table align="center">
                                        <tr>
                                            <td>
                                                <dxe:ASPxButton ID="btnInsertar" runat="server" CommandName="Insert" 
                                                    CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                    CssPostfix="Office2003_Olive" Text="Insertar" 
                                                    ValidationGroup="EditarInsertar">
                                                </dxe:ASPxButton>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                            <td>
                                                <dxe:ASPxButton ID="btnCancelar" runat="server" CausesValidation="False" 
                                                    CommandName="Cancel" CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                    CssPostfix="Office2003_Olive" Text="Cancelar" ValidationGroup="EditarInsertar">
                                                </dxe:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                    <asp:HiddenField ID="hfEstaActivo" runat="server" 
                                        Value='<%# Bind("EstaActiva") %>' />
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <table class="style1" cellpadding="2" cellspacing="2">
                            <tr>
                                <td class="dxncEmptyData_Soft_Orange">
                                        Razón social</td>
                                <td class="style3" nowrap="nowrap">
                                    <asp:Label ID="RazonSocialLabel" runat="server" 
                                            Text='<%# Eval("RazonSocial") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style2">
                                        CUIT</td>
                                <td style="text-align: left" class="style2">
                                    <asp:Label ID="CUITLabel" runat="server" 
                                            Text='<%# Eval("CUIT") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Descripción</td>
                                <td class="style3" nowrap="nowrap" >
                                    <asp:Label ID="DescripcionLabel" runat="server" 
                                        Text='<%# Eval("Descripcion") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Nombre contacto</td>
                                <td class="style3" nowrap="nowrap" >
                                    <asp:Label ID="NombreContactoLabel" runat="server" 
                                        Text='<%# Eval("ContactoNombre") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Teléfono contacto</td>
                                <td class="style3" nowrap="nowrap" >
                                    <asp:Label ID="TelefonoContactoLabel" runat="server" 
                                        Text='<%# Eval("ContactoTelefono") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    E-mail</td>
                                <td class="style3" >
                                    <asp:Label ID="EmailLabel" runat="server" Text='<%# Eval("Email") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Dirección</td>
                                <td class="style3" nowrap="nowrap" >
                                    <asp:Label ID="DireccionLabel" runat="server" Text='<%# Eval("Direccion") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    Dias de cuenta corriente</td>
                                <td class="style3" >
                                    <asp:Label ID="DiasCuentaCorrienteLabel" runat="server" 
                                        Text='<%# Eval("DiasDuracionCuentaCorriente") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    </td>
                                <td class="style3" ></td>
                            </tr>
                            <tr>
                                <td colspan="2" align="center">
                                    <table>
                                        <tr>
                                            <td>
                                                <dxe:aspxbutton ID="btnEditar" runat="server" CommandName="Edit" 
                                                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="Editar">
                                                </dxe:ASPxButton>
                                            </td>
                                            <td>
                                                <dxe:aspxbutton ID="btnNuevo" runat="server" CommandName="New" 
                                                        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                                        CssPostfix="Office2003_Olive" Text="Nuevo" 
                                                        ToolTip="Crea un nueva unidad de medida">
                                                </dxe:ASPxButton>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:FormView>
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="dsAseguradora" runat="server" 
        OldValuesParameterFormatString="original_{0}" 
        SelectMethod="CrearAseguradora" 
    TypeName="SGT_ON.Aseguradora" 
        oninserted="dsUnidadDeMedida_Inserted" 
    DataObjectTypeName="SGT_ON.Aseguradora" InsertMethod="Insertar" 
    UpdateMethod="Actualizar">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="-1" Name="pID" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <br />
    <dxpc:aspxpopupcontrol ID="popBusqueda" runat="server" 
            AutoUpdatePosition="True" 
            CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
            CssPostfix="Office2003_Olive" EnableHotTrack="False" 
            HeaderText="Aseguradoras" 
            ImageFolder="~/App_Themes/Office2003Olive/{0}/" Modal="True" 
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
        <CloseButtonImage Height="12px" Width="13px" />
        <SizeGripImage Height="16px" Width="16px" />
        <HeaderStyle>
        <Paddings PaddingRight="6px" />
        </HeaderStyle>
        <ContentCollection>
            <dxpc:PopupControlContentControl runat="server" SupportsDisabledAttribute="True">
                <table align="center">
                    <tr>
                        <td align="center">
                            <dxwgv:ASPxGridView ID="gvAseguradoras" runat="server" 
        AutoGenerateColumns="False" 
        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
        CssPostfix="Office2003_Olive" DataSourceID="dsAseguradoras" 
        KeyFieldName="ID" style="text-align: left" Width="100%">
                                <Columns>
                                    <dxwgv:GridViewDataTextColumn Caption="Razón social" 
                ShowInCustomizationForm="True" VisibleIndex="0" FieldName="RazonSocial">
                                        <DataItemTemplate>
                                            <a ID="clickElement" href="Aseguradora.aspx?ID=<%# Container.KeyValue%>" 
                        target="_self"><%# Eval("RazonSocial")%></a>
                                        </DataItemTemplate>
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn Caption="Contacto" FieldName="ContactoNombre" 
                                        ShowInCustomizationForm="True" VisibleIndex="1">
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn Caption="Teléfono" FieldName="ContactoTelefono" 
                                        ShowInCustomizationForm="True" VisibleIndex="2">
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn Caption="Cta. cte." 
                                        FieldName="DiasDuracionCuentaCorriente" ShowInCustomizationForm="True" 
                                        VisibleIndex="3">
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                </Columns>
                                <SettingsBehavior AllowFocusedRow="True" EnableRowHotTrack="True" />
                                <SettingsPager PageSize="20">
                                </SettingsPager>
                                <Images ImageFolder="~/App_Themes/Office2003Olive/{0}/">
                                    <CollapsedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                Width="11px" />
                                    <ExpandedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                    <DetailCollapsedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                Width="11px" />
                                    <DetailExpandedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                    <FilterRowButton Height="13px" Width="13px" />
                                </Images>
                                <Styles CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
            CssPostfix="Office2003_Olive">
                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                    </Header>
                                    <LoadingPanel ImageSpacing="10px">
                                    </LoadingPanel>
                                </Styles>
                                <StylesEditors>
                                    <ProgressBar Height="25px">
                                    </ProgressBar>
                                </StylesEditors>
                                <Templates>
                                    <EmptyDataRow>
                                        <br />
                                        <span class="dxncEmptyData_Soft_Orange">No se encontraron registros</span><br />
                                    </EmptyDataRow>
                                </Templates>
                            </dxwgv:ASPxGridView>
                        </td>
                    </tr>
                </table>
                <asp:ObjectDataSource ID="dsAseguradoras" runat="server" 
        SelectMethod="ObtenerPorTexto" 
        TypeName="SGT_ON.Aseguradora" 
        OldValuesParameterFormatString="original_{0}">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtBuscar" Name="pTexto" PropertyName="Text" 
                            Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </dxpc:PopupControlContentControl>
        </ContentCollection>
    </dxpc:aspxpopupcontrol>
</asp:Content>

